package com.asia5b.a5mall.middleware.model.order

import com.asia5b.a5bmall.resource.ResString
import com.asia5b.a5mall.middleware.R
import com.asia5b.a5mall.middleware.model.base.BaseModel
import com.asia5b.a5mall.middleware.model.bean.MenuBean

/**
 * Created by zhangyuncai on 2020/1/14.
 */
class OrderActionModel : BaseModel() {
    /*
    "allow_cancel": false,
"allow_confirm": false,
"allow_pay": false,
"allow_ship": false,
"allow_rog": false,
"allow_comment": false,
"allow_complete": false,
"allow_apply_service": false,
"allow_service_cancel": false,
"allow_check_express": true,
"allow_edit_consignee": false,
"allow_edit_price": false
     */

    /** 是否允许被取消 */
    var allow_cancel = false
    /** 是否允许被确认 */
    var allow_confirm = false
    /** 是否允许被支付 */
    var allow_pay = false
    /** 是否允许被发货 */
    var allow_ship = false
    /** 是否允许被收货 */
    var allow_rog = false
    /** 是否允许被评论 */
    var allow_comment = false
    /** 是否允许被完成 */
    var allow_complete = false
    /** 是否允许申请售后 */
    var allow_apply_service = false
    /** 是否允许取消(售后) */
    var allow_service_cancel = false
    /*后期添加*/
    /*是否可以查看物流  "ship_status") != "SHIP_NO"*/
    var allowExpress = false
    /*后期添加 取消订单*/
    var cancelState = false
        get() {
            return allow_service_cancel || allow_cancel
        }
    //是否允许查看物流信息
    var allow_check_express=false
    //是否允许更改收货人信息
    var allow_edit_consignee=false
    //是否允许更改价格
    var allow_edit_price=false

    fun getActionList(): ArrayList<MenuBean> {
        var actionList = arrayListOf<MenuBean>()
        //todo 先黑后蓝
        if (allow_check_express) {//黑色
            actionList.add(MenuBean(0, "check_logis", ResString.get(R.string.查看物流)))
        }
        if (allow_apply_service) {//黑色
            actionList.add(MenuBean(0, "allow_apply_service", ResString.get(R.string.申请售后2)))
        }
        if (cancelState) {//黑色
            actionList.add(MenuBean(0, "cancel_order", ResString.get(R.string.取消订单)))
        }
        if (allow_rog) {//蓝色
            actionList.add(MenuBean(1, "allow_rog", ResString.get(R.string.确认收货)))
        }
        if (allow_pay) {//蓝色
            actionList.add(MenuBean(1, "allow_pay", ResString.get(R.string.立即付款)))
        }
        if (allow_comment) {//蓝色
            actionList.add(MenuBean(1, "allow_comment", ResString.get(R.string.立即评论)))
        }

        //查看退款 0
        //取消退款 0
        //补差价 1
        //追评 1
        //评价 1
        //申请打包
        return actionList
    }
}
/*
"allow_cancel": false,
"allow_confirm": false,
"allow_pay": false,
"allow_ship": false,
"allow_rog": false,
"allow_comment": false,
"allow_complete": false,
"allow_apply_service": false,
"allow_service_cancel": false,
"allow_check_express": true,
"allow_edit_consignee": false,
"allow_edit_price": false
 */